<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>123</div>

    <script>

        const el = document.querySelector('div');

        function onClick (e) {
            // e.s
            alert('hello');
            // 删除事件的时候必须指定函数名
            el.removeEventListener('click', onClick);
        }

        el.addEventListener('click', function (e) {
            e.stopPropagation();
        });



    </script>
</body>
</html>